package com.woniu.his.sms.client;

import com.woniu.his.result.Result;
import com.woniu.his.sms.client.param.FindDeptParam;
import com.woniu.his.sms.client.result.DeptResult;
import com.woniu.his.sms.client.result.PageDeptResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;

@FeignClient(contextId = "SmsDeptQueryClient",name="sms",path = "sms")
public interface SmsDeptQueryClient {

    /**
     * 模糊查找科室（根据类别，科室名，科室编码，可以为空）
     *
     * @param param 参数
     * @return {@link Result}<{@link PageDeptResult}>
     */
    @PostMapping("/findDeptByCondition")
    public Result<PageDeptResult> findDept(@RequestBody @Valid FindDeptParam param);

    /**
     * 找到所有科室
     *
     * @return {@link Result}<{@link List}<{@link DeptResult}>>
     */
    @GetMapping("/findAllDept")
    public Result<List<DeptResult>> FindAllDept();

    /**
     * 发现科室通过id
     *
     * @param id id
     * @return {@link Result}<{@link DeptResult}>
     */
    @GetMapping("/findDeptById")
    public Result<DeptResult> findDeptById(@RequestParam("id") Integer id);
}
